<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Mosaic plot</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Mosaic_plot"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Mosaic_plot rootpage-Mosaic_plot skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Mosaic plot</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>A <b>mosaic plot</b>, <b>Marimekko chart</b>, <b>Mekko chart</b>, or sometimes <b>percent stacked bar plot</b>, is a graphical visualization of data from two or more qualitative variables.<sup id="cite_ref-Schlotzhauer2007_1-0" class="reference"><a href="#cite_note-Schlotzhauer2007-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> It is the multidimensional extension of spineplots, which graphically display the same information for only one variable.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> It gives an overview of the data and makes it possible to recognize relationships between different variables. For example, independence is shown when the boxes across categories all have the same areas.<sup id="cite_ref-Friendly1991_3-0" class="reference"><a href="#cite_note-Friendly1991-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> Mosaic plots were introduced by Hartigan and Kleiner in 1981 and expanded on by Friendly in 1994.<sup id="cite_ref-Institute2013_4-0" class="reference"><a href="#cite_note-Institute2013-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-FriendlyMeyer2016_5-0" class="reference"><a href="#cite_note-FriendlyMeyer2016-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
Mosaic plots are also called <b>Marimekko</b> or <b>Mekko charts</b> because they resemble some <a href="Marimekko" title="Marimekko">Marimekko</a> prints.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-mekkog_7-0" class="reference"><a href="#cite_note-mekkog-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> However, in statistical applications, mosaic plots can be colored and shaded according to deviations from independence, whereas
Marimekko charts are colored according to the category levels, as in the image.
</p><p>As with <a href="Bar_chart" title="Bar chart">bar charts</a> and spineplots, the area of the tiles, also known as the bin size, is proportional to the number of observations within that category.<sup id="cite_ref-TheusUrbanek2011_8-0" class="reference"><a href="#cite_note-TheusUrbanek2011-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Example">Example</h2></div>
<p>An example of mosaic plots uses data from the passengers on the <i><a href="Titanic" title="Titanic">Titanic</a></i>. There are 2201 observations and 3 variables. The variables are:
</p>
<ul><li>the gender of the person (male / female)</li>
<li>the class (1st, 2nd and 3rd class, or crew)</li>
<li>did this person survive the sinking (yes / no)?</li></ul>
<table class="wikitable">
<tbody><tr>
<th>Gender
</th>
<th>Survived
</th>
<th>1st Class
</th>
<th>2nd Class
</th>
<th>3rd Class
</th>
<th>Crew
</th></tr>
<tr>
<td rowspan="2">Male
</td>
<td>No
</td>
<td align="right">118
</td>
<td align="right">154
</td>
<td align="right">422
</td>
<td align="right">670
</td></tr>
<tr>
<td>Yes
</td>
<td align="right">62
</td>
<td align="right">25
</td>
<td align="right">88
</td>
<td align="right">192
</td></tr>
<tr>
<td rowspan="2">Female
</td>
<td>No
</td>
<td align="right">4
</td>
<td align="right">13
</td>
<td align="right">106
</td>
<td align="right">3
</td></tr>
<tr>
<td>Yes
</td>
<td align="right">141
</td>
<td align="right">93
</td>
<td align="right">90
</td>
<td align="right">20
</td></tr></tbody></table>
<div class="mw-heading mw-heading3"><h3 id="Mosaic_plot_construction">Mosaic plot construction</h3></div>
<table class="wikitable floatright">
<tbody><tr>
<th>Order</th>
<th>Variable</th>
<th>Axis
</th></tr>
<tr>
<td>1.</td>
<td>Gender</td>
<td>Vertical
</td></tr>
<tr>
<td>2.</td>
<td>Class</td>
<td>Horizontal
</td></tr>
<tr>
<td>3.</td>
<td>Survived</td>
<td>Vertical
</td></tr></tbody></table>
<p>The categorical variables are first put in order. Then, each variable is assigned to an axis. In the table to the right, sequence and classification is presented for this data set. Another ordering will result in a different mosaic plot, i.e., the order of the variables is significant as for all multivariate plots.
</p><p>At the left edge of the first variable we first plot "Gender," meaning that we divide the data vertically in two blocks: the bottom blocks corresponds to females, while the upper (much larger) one to males. One immediately sees that roughly a quarter of the passengers were female and the remaining three quarters male.
</p><p>One then applies the second variable "Class" to the top edge. The four vertical columns therefore mark the four values of that variable (1st, 2nd, 3rd, and crew). These columns are of variable thickness, because column width indicates the relative proportion of the corresponding value on the population. Crew plainly represents the largest male group, whereas third-class passengers are the largest female group. The number of female crew members is also seen to have been marginal.
</p><p>The last variable ("Survived") is finally applied, this time along the left edge with the result highlighted by shade: dark grey rectangles represent people that did not survive the disaster, light grey ones people that did. Women in the first class are immediately seen to have had the highest survival probability. The survival probability for females is seen to have been higher than that for men (marginalised over all classes). Similarly, a marginalization over gender identifies first-class passengers as most probable to survive. Overall, about 1/3 of all people survived (proportion of light gray areas).
</p>
<div class="center">
<p><span class="mw-default-size" typeof="mw:File"></span>
</p>
</div>
<div class="mw-heading mw-heading2"><h2 id="Properties">Properties</h2></div>
<ul><li>The displayed variables are categorical or ordinal scales.</li>
<li>The plot is of at least two variables. There is no upper limit, but too many variables may be confusing in graphic form.</li>
<li>The number of observations is not limited, but not read in the image.</li>
<li>The areas of the rectangular tiles that are available for a combination of features are proportional to the number of observations that have this combination of features.</li>
<li>Unlike, for example, the <a href="Boxplot" class="mw-redirect" title="Boxplot">boxplot</a> or <a href="QQ_plot" class="mw-redirect" title="QQ plot">QQ plot</a>, it is not possible for the mosaic plot to plot a confidence interval. However, the tiles can be colored according to the standardized residual from a model of independence, so that cells with excessively large or small deviations are shaded to show those that are 'significant' and the pattern of association can be discerned.</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Criticism">Criticism</h2></div>
<p>The mosaic plot has been criticised for making the data hard to perceive and to compare visually, because the values correspond to areas.<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-mekkog_7-1" class="reference"><a href="#cite_note-mekkog-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Heat_map" title="Heat map">Heat map</a></li>
<li><a href="Treemap" class="mw-redirect" title="Treemap">Treemap</a></li>
<li><a href="Contingency_table" title="Contingency table">Contingency table</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-Schlotzhauer2007-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-Schlotzhauer2007_1-0">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFSandra_D._Schlotzhauer2007" class="citation book cs1">Sandra D. Schlotzhauer (1 April 2007). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=5JYM1WxGDz8C&pg=PA407"><i>Elementary Statistics Using JMP</i></a>. SAS Institute. p. 407. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-59994-428-9</bdi>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation book cs1"><a rel="nofollow" class="external text" href="https://books.google.com/books?id=-Pp8hbwAtq8C&pg=PA254"><i>New Techniques and Technologies for Statistics II: Proceedings of the Second Bonn Seminar</i></a>. IOS Press. 1 January 1997. p. 254. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-90-5199-326-4</bdi>.</cite></span>
</li>
<li id="cite_note-Friendly1991-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-Friendly1991_3-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFMichael_Friendly1991" class="citation book cs1">Michael Friendly (1 January 1991). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=bBIUdg5LjeUC&pg=PA512"><i>SAS System for Statistical Graphics</i></a>. SAS Institute. pp. 512–. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-55544-441-9</bdi>.</cite></span>
</li>
<li id="cite_note-Institute2013-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-Institute2013_4-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFSAS_Institute2013" class="citation book cs1">SAS Institute (6 September 2013). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=US_pAAAAQBAJ&pg=PT251"><i>JMP 11 Basic Analysis</i></a>. SAS Institute. pp. 251–. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-61290-684-3</bdi>.</cite></span>
</li>
<li id="cite_note-FriendlyMeyer2016-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-FriendlyMeyer2016_5-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFMichael_Friendly_&_David_Meyer2016" class="citation book cs1">Michael Friendly & David Meyer (2016). <i>Discrete Data Analysis with R: Visualization and Modeling Techniques for Categorical and Count Data</i>. Chapman & Hall/CRC. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-4987-2583-5</bdi>.</cite></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite id="CITEREFSmith2017" class="citation news cs1">Smith, Alan (6 September 2017). <a rel="nofollow" class="external text" href="https://www.ft.com/content/3ee98782-9149-11e7-a9e6-11d2f0ebb7f0">"How to apply Marimekko to data"</a>. <i>Financial Times</i><span class="reference-accessdate">. Retrieved <span class="nowrap">27 September</span> 2019</span>.</cite></span>
</li>
<li id="cite_note-mekkog-7"><span class="mw-cite-backlink">^ <a href="#cite_ref-mekkog_7-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-mekkog_7-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.mekkographics.com/resources/charts-by-type/marimekko/">"Marimekko Chart"</a>. <i>Mekko Graphics</i><span class="reference-accessdate">. Retrieved <span class="nowrap">13 December</span> 2017</span>.</cite></span>
</li>
<li id="cite_note-TheusUrbanek2011-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-TheusUrbanek2011_8-0">^</a></b></span> <span class="reference-text"><cite id="CITEREFMartin_TheusSimon_Urbanek2011" class="citation book cs1">Martin Theus; Simon Urbanek (23 March 2011). <a rel="nofollow" class="external text" href="https://books.google.com/books?id=xHIH1Q47FeoC&pg=PA31"><i>Interactive Graphics for Data Analysis: Principles and Examples</i></a>. CRC Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>978-1-4200-1106-7</bdi>.</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite id="CITEREFFew" class="citation web cs1">Few, Stephen. <a rel="nofollow" class="external text" href="http://www.perceptualedge.com/example13.php">"Design Example: Marimekko Chart"</a>. <i>Perceptual Edge</i><span class="reference-accessdate">. Retrieved <span class="nowrap">30 October</span> 2011</span>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2></div>
<ul><li>John Hartigan, Beat Kleiner: <i>Mosaics for contingency tables</i>. In: <i>Computer Science and Statistics: Proceedings of the 13th Symposium on the Interface</i>. 1981, S. 268–273.</li>
<li>Michael Friendly: <i>A Brief History of the Mosaic Display</i> In: <i>Journal of Computational and Graphical Statistics</i>, 2002, 11, 89–107. [The earliest known mosaic display goes back to Georg von Mayr (1877).]</li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-04-17" href="https://en.wikipedia.org/wiki/?title=Mosaic_plot&oldid=1286087802">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>